package data
{
	public class RateLevel
	{
		public var level:int =10;
		public var baseMoney:int=10000;
		public var manRate:Vector.<RateYear>;
		public var womenRate:Vector.<RateYear>;
		public function RateLevel()
		{
		}
		
		public function getRateByeQJ(sex:int,age:int,qj:int):Rate{
			var rate:Vector.<RateYear> = sex==Config.MAN?manRate:womenRate;
			var rateYear:RateYear;
			for each(rateYear in rate){
					if(rateYear.year == qj){
					for each(var rateage:Rate in rateYear.ageRate){
						if(rateage.age==age){
							
							return rateage;
						}
					}
					
				}
			}
			return null;
		}
		
		public function getRateByeAge(sex:int,age:int):Rate{
			var rate:Vector.<RateYear> = sex==Config.MAN?manRate:womenRate;
			var rateYear:RateYear;
			for each(rateYear in rate){
				for each(var rateage:Rate in rateYear.ageRate){
					if(rateage.age==age){
						
						return rateage;
					}
				}
				
			}
			return null;
		}
	}
}